<?php echo '<?xml version="1.0" encoding="UTF-8"?>' ?>

<feed xmlns="http://www.w3.org/2005/Atom">
  <title>G. B. AABB</title>
  <subtitle>Últimas notícias</subtitle>
  <link href="<?php echo url_for('@news?sf_format=atom', true) ?>" rel="self"/>
  <link href="<?php echo url_for('@homepage', true) ?>"/>
  <updated><?php echo gmstrftime('%Y-%m-%dT%H:%M:%SZ', current(BolaoNewsPeer::getLastNews(1))->getCreatedAt('U')) ?></updated>
  <author>
    <name>G. B. AABB</name>
  </author>
  <id><?php echo sha1(url_for('@news?sf_format=atom', true)) ?></id>
 
<?php use_helper('Text') ?>
<?php foreach ($news_list as $news): ?>
  <?php
    // Mount title
    $title =  $news->getBolaoCategory()->getName();
    if($news->hasBolaoSubcategory())
      $title .= '('.$news->getBolaoSubcategory()->getName().')';
    $title .= ' - '.$news->getSummary();
  ?>
  <entry>
    <title><?php echo $title ?></title>
    <link href="<?php echo url_for('news_show', $news, true) ?>" />
    <id><?php echo sha1($news->getId()) ?></id>
    <updated><?php echo gmstrftime('%Y-%m-%dT%H:%M:%SZ', $news->getCreatedAt('U')) ?></updated>
    <summary type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <?php echo simple_format_text($news->getDescription()) ?>
      </div>
    </summary>
    <author>
      <name><?php echo $news->getCreator() ?></name>
    </author>
  </entry>
<?php endforeach; ?>
</feed>
